package com.shuai;

/**
 * @author shuaihong-coding
 * @date 2025/10/3
 * @className EagerSingleton
 */
public class EagerSingleton {

    /**
     * 静态变量，在类加载的时候就初始化
     */
    private static final EagerSingleton singleton = new EagerSingleton();

    /**
     * 私有化构造器，避免外部创建实例
     */
    private EagerSingleton(){}

    /**
     * 获取单例
     * @return
     */

    public static EagerSingleton getSingleton(){
        return singleton;
    }

}
